package com.example.higo.model.impl.maishou;


import com.example.higo.api.service.BaseSubscriber;
import com.example.higo.api.service.RetrofitManager;
import com.example.higo.model.IMaishouModel;
import com.example.higo.model.entity.maishou.MaishouBody;
import com.example.higo.model.entity.maishou.MaishouTab;

import java.util.Map;

import rx.android.schedulers.AndroidSchedulers;
import rx.schedulers.Schedulers;


/**
 * Created by wj on 2016/11/8.
 */

public class MaishouModelImp implements IMaishouModel {


    @Override
    public void getMaishouTabModel(BaseSubscriber<MaishouTab> subscriber) {
        RetrofitManager.getInstance()
                .getMaishouCallBack()
                .getMaishouTabData()
                .observeOn(AndroidSchedulers.mainThread())
                .subscribeOn(Schedulers.io())
                .subscribe(subscriber);
    }

    @Override
    public void getMaishouBodyModel(BaseSubscriber<MaishouBody> subscriber,Map<String,String> map) {
            RetrofitManager.getInstance()
                    .getMaishouCallBack()
                    .getMaishouBodyData(map)
                    .observeOn(AndroidSchedulers.mainThread())
                    .subscribeOn(Schedulers.io())
                    .subscribe(subscriber);
    }
}
